var n = require("../../../@babel/runtime/helpers/interopRequireDefault"), t = n(require("../DPagination")), i = n(require("../DHttp")), e = new t.default("historyList");

Page({
    data: {
        historyList: {},
        giveHistoryCount: 0
    },
    onLoad: function(n) {
        e.bind(this), e.clean(), this.getHistory();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.getHistory();
    },
    onShareAppMessage: function() {},
    getHistory: function() {
        var n = this;
        e.loading || e.finished || (wx.showLoading({
            title: "加载中",
            mask: !0
        }), e.loading = !0, i.default.request("plugin.credit-inventory.frontend.controllers.give.index").then(function(t) {
            var i = t.data, o = t.per_page, a = t.current_page, r = t.last_page;
            e.loading = !1, wx.hideLoading(), (r == a || i.length < o) && (e.finished = !0), 
            e.push(i), n.setData({
                giveHistoryCount: n.data.giveHistoryCount + i.length
            });
        }).catch(function(n) {
            var t = n.msg;
            e.loading = !1, wx.hideLoading(), wx.showToast({
                title: t,
                icon: "none"
            });
        }));
    }
});